package com.w.picture.common;

import com.w.picture.exception.ErrorCode;
import lombok.Getter;
import lombok.Setter;

/**
 * @author wzp
 * @since 2024/12/7
 */
@Getter
@Setter
public class BaseResponse<T> {
    private int code;
    private String message;
    private T data;


    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), errorCode.getMessage(), null);
    }

    public BaseResponse(int code, String message) {
        this(code,message,null);
    }
    public BaseResponse(int code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }
}
